<template>
  <div class="menu_list">
    <!-- justify="space-between" -->
    <el-row :gutter="20" type="flex">
      <el-col
        :style="{ margin, width }"
        v-for="val in menuList.list"
        :key="val.menuId"
      >
        <router-link to="">
          <el-image
            :src="val.product_pic_url"
            fit="fill"
            :lazy="true"
          ></el-image>
          <h5>{{ val.title }}</h5>
          <p>{{ val.comments_len }} 评论</p>
          <p class="menu_list_name">{{ val.name }}</p>
        </router-link>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: {
    menuList: {
      type: Object,
      default: () => {},
    },
    width: {
      type: String,
      default: "19%",
    },
    margin: {
      type: String,
      default: "10px 5px",
    },
  },
  mounted() {
    // console.log(this.menuList);
  },
};
</script>

<style lang="stylus">
.menu_list {
  .el-row--flex {
    flex-wrap: wrap;
    // justify-content: flex-start;
  }

  .el-col {
    background: #fff;
    margin-bottom: 20px;
    padding: 0 0 10px 0 !important;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

    .el-image {
      width: 100%;
    }

    img {
      border-radius: 4px;
    }

    h5 {
      line-height: 3em;
      margin-left: 16px;
      font-size: 18px;
    }

    p {
      line-height: 30px;
      margin-left: 16px;
      font-size: 14px;
    }

    .menu_list_name {
      color: #e62e2d;
    }
  }
}
</style>